/**
 * 如何获取DOM元素
 */
import React, { createRef } from 'react'

class NewInput extends React.Component {
  // 初始化一个DOM对象容器
  refDom = createRef()

  changeValue = () => {
    console.log(this.refDom.current.value)
  }

  render () {
    return <input ref={this.refDom} onChange={this.changeValue} />
  }
}

export default NewInput